package database;

public class DBTest {

	static public void user() {

		DBManager dbm = new DBManager();
		dbm.initialize();
		String name = "UserAcc";
		String[] colName = { "user", "pwd" };
		int[] colLen = { 10, 20 };
		dbm.creat(name, colName, colLen);

		String[] addUsb = { "xuzhuoran", "sb" };
		String[] addUsg = { "huicong", "sg" };

		String[] coln1 = { "user" };
		String[] colu1 = { "zwj" };

		dbm.add(colName, addUsb);
		dbm.add(colName, addUsg);
		dbm.add(coln1, colu1);

		String[] getName = { "user", "pwd" };
		String when = "user";
		String whenEq = "xuzhuoran";

		System.out.println(dbm.query(getName, when, whenEq).get(0)[1]);

		System.out.println(dbm.getAll().size());

		dbm.finalize();
	}

	static public void main(String[] args) {

		// DBManager dbm = new DBManager();
		// dbm.initialize();
		//
		// String name = "TEST1";
		// String[] colName = { "id1", "id2", "id3", "id4" };
		// int[] colLen = { 1, 100, 200, 220 };
		//
		// dbm.creat(name, colName, colLen);
		//
		// String[] iname = { "id1", "id2", "id3", "id4" };
		// String[] ivalue = { "`", "11111111", "avf", "32r4" };
		// dbm.add(iname, ivalue);
		//
		// String[] iname1 = { "id3", "id4" };
		// String[] ivalue1 = { "id1", "id2" };
		// dbm.add(iname1, ivalue1);
		//
		// String[] getName = { "id2" };
		// String when = "id3";
		// String whenEq = "avf";
		// System.out.println(dbm.query(getName, when, whenEq).get(0)[0]);
		//
		// dbm.finalize();

		user();
	}

}
